package other;

public class HanoiTower {
    public static void main(String[] args) {
        representation(3);
    }

    public static void step(int index, String start, String mid, String end){
        if(index==1){
            System.out.println("将第"+index+"个圆盘从"+start+"移动到"+end);
        }else {
            step(index-1,start,end,mid);
            System.out.println("将第"+index+"个圆盘从"+start+"移动到"+end);
            step(index-1,mid,start,end);
        }
    }
    public static void representation(int num){
        step(num,"A","B","C");
    }
}
